package com.xyrl.third.baidu.configuration;

import com.xyrl.third.baidu.config.BaiduAiProperties;
import com.xyrl.third.baidu.service.PersonVerifyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnClass(value = PersonVerifyService.class)
@EnableConfigurationProperties(BaiduAiProperties.class)
@Slf4j
public class BaiduAIAutoConfiguration {


    @Bean
    @ConditionalOnMissingBean(PersonVerifyService.class)
    public PersonVerifyService baiduAiPersonVerifyService() {
        PersonVerifyService personVerifyService = new PersonVerifyService();
        return personVerifyService;
    }
}
